package com.example.tang.zhayan.utils;

import org.xutils.http.RequestParams;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * Created by tang on 2015/12/12.
 * 获取RequsetParams
 */
public class ResultParamsUtils {

    /**
     * 根据Map<String,String> 获取RequestParams
     *
     * @param path
     * @param map
     * @return
     */
    public static RequestParams getIDParams(String path, Map<String, String> map) {
        RequestParams params = new RequestParams(path);
        Set<String> set = map.keySet();
        Iterator<String> iterator = set.iterator();
        while (iterator.hasNext()) {
            String key = iterator.next();
            String value = map.get(key);
            params.addBodyParameter(key, value);
        }
        return params;
    }


}
